<template>
  <div class="components-container">
    <code>
      Based on <a class="link-type" href="https://github.com/rowanwins/vue-dropzone"> dropzone </a>.
      {{ $t('components.dropzoneTips') }}
    </code>
    <div class="editor-container">
      <dropzone id="myVueDropzone" :url="url" @dropzone-removedFile="dropzoneR" @dropzone-success="dropzoneS" @dropzone-successmultiple="successOk"/>
    </div>
  </div>
</template>

<script>
import Dropzone from '@/components/Dropzone'

/**
 * https://www.cnblogs.com/fu-yong/p/9053515.html
 * https://www.cnblogs.com/cxint/p/6861731.html
 */
export default {
  name: 'DropzoneDemo',
  components: { Dropzone },
  data() {
    return {
      url: process.env.BASE_API + 'syProductInfo/upload/1',
    }
  },
  methods: {
    dropzoneS(file) {
      //this.$message({ message: 'Upload success', type: 'success' })
    },
    dropzoneR(file) {
      this.$message({ message: 'Delete success', type: 'success' })
    },
    successOk(file) {
      this.$message({ message: '全部完成', type: 'success' })
    }
  }
}
</script>

